package com.xy.dp.composite;

public class Doc implements Component {
    private String name;

    public Doc(String name) {
        this.name = name;
    }
    @Override
    public void add(Component c) {

    }

    @Override
    public void remove(Component c) {

    }

    @Override
    public void display(int depth) {
        System.out.println("depth: " + getLines(depth) + " " + name);
    }

    private String getLines(int depth) {
        String lines = "";
        for (int i = 0; i < depth; i++) {
            lines += "-";
        }
        return lines;
    }
}
